package com.example.gulimall.ware.dao;

import com.example.common.entity.ware.WareOrderTaskDetailEntity;
import com.example.common.to.ware.SkuHasStockTo;
import com.example.common.vo.ware.SkuWareHasStockVo;
import com.example.gulimall.ware.entity.WareSkuEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 商品库存
 * 
 * @author zyred
 * @email zyred@163.com
 * @date 2021-08-23 11:58:31
 */
@Mapper
public interface WareSkuDao extends BaseMapper<WareSkuEntity> {

    void updateBatchByCondition(@Param("success") List<WareSkuEntity> success);

    List<SkuHasStockTo> selectStock(@Param("skuIds") List<Long> skuIds);

    void doLockStock(@Param("stock") SkuWareHasStockVo stock);

    void updateBatchUnlockStock(@Param("detail") WareOrderTaskDetailEntity container);
}
